﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PDMan
{
    public class FieldsItem
    {
        /// <summary>
        /// 
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string type { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 主键标识
        /// </summary>
        public string chnname { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public bool pk { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public bool notNull { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public bool autoIncrement { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string uiHint { get; set; }
    }

    public class HeadersItem
    {
        /// <summary>
        /// 
        /// </summary>
        public string fieldName { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string relationNoShow { get; set; }
    }

    public class EntitiesItem
    {
        /// <summary>
        /// 
        /// </summary>
        public string title { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<FieldsItem> fields { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<string> indexs { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<HeadersItem> headers { get; set; }
        /// <summary>
        /// 手动填报的康复数据
        /// </summary>
        public string chnname { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string remark { get; set; }
    }

    public class NodesItem
    {
        /// <summary>
        /// 
        /// </summary>
        public string shape { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string title { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string moduleName { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public double x { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public double y { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string id { get; set; }
    }

    public class ControlPointsItem
    {
        /// <summary>
        /// 
        /// </summary>
        public double x { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public double y { get; set; }
    }

    public class EdgesItem
    {
        /// <summary>
        /// 
        /// </summary>
        public string shape { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string relation { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string source { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string target { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<ControlPointsItem> controlPoints { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int sourceAnchor { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int targetAnchor { get; set; }
    }

    public class GraphCanvas
    {
        /// <summary>
        /// 
        /// </summary>
        public List<NodesItem> nodes { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<EdgesItem> edges { get; set; }
    }

    public class @from
    {
        /// <summary>
        /// 
        /// </summary>
        public string entity { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string field { get; set; }
    }

    public class To
    {
        /// <summary>
        /// 
        /// </summary>
        public string entity { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string field { get; set; }
    }

    public class AssociationsItem
    {
        /// <summary>
        /// 
        /// </summary>
        public string relation { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public @from @from { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public To to { get; set; }
    }

    public class ModulesItem
    {
        /// <summary>
        /// 
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 自动上报部分
        /// </summary>
        public string chnname { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<EntitiesItem> entities { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public GraphCanvas graphCanvas { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<AssociationsItem> associations { get; set; }
    }

    public class JAVA
    {
        /// <summary>
        /// 
        /// </summary>
        public string type { get; set; }
    }

    public class MYSQL
    {
        /// <summary>
        /// 
        /// </summary>
        public string type { get; set; }
    }

    public class ORACLE
    {
        /// <summary>
        /// 
        /// </summary>
        public string type { get; set; }
    }

    public class SQLServer
    {
        /// <summary>
        /// 
        /// </summary>
        public string type { get; set; }
    }

    public class PostgreSQL
    {
        /// <summary>
        /// 
        /// </summary>
        public string type { get; set; }
    }

    public class CSharp
    {
        /// <summary>
        /// 
        /// </summary>
        public string type { get; set; }
    }

    public class Apply
    {
        /// <summary>
        /// 
        /// </summary>
        public JAVA JAVA { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public MYSQL MYSQL { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public ORACLE ORACLE { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public SQLServer SQLServer { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public PostgreSQL PostgreSQL { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public CSharp CSharp { get; set; }
}

    public class DatatypeItem
    {
        /// <summary>
        /// 默认字串
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string code { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public Apply apply { get; set; }
    }

    public class DatabaseItem
    {
        /// <summary>
        /// 
        /// </summary>
        public string code { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string template { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string fileShow { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string defaultDatabase { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string createTableTemplate { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string deleteTableTemplate { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string rebuildTableTemplate { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string createFieldTemplate { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string updateFieldTemplate { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string deleteFieldTemplate { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string deleteIndexTemplate { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string createIndexTemplate { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string updateTableComment { get; set; }
    }

    public class DataTypeDomains
    {
        /// <summary>
        /// 
        /// </summary>
        public List<DatatypeItem> datatype { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<DatabaseItem> database { get; set; }
    }

    public class DefaultFieldsItem
    {
        /// <summary>
        /// 
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string type { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 乐观锁
        /// </summary>
        public string chnname { get; set; }
    }

    public class JavaConfig
    {
    }

    public class Profile
    {
        /// <summary>
        /// 
        /// </summary>
        public List<DefaultFieldsItem> defaultFields { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string defaultFieldsType { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public JavaConfig javaConfig { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string sqlConfig { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public List<string> dbs { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string wordTemplateConfig { get; set; }
    }

    public class PDMan
    {
        /// <summary>
        /// 
        /// </summary>
        public List<ModulesItem> modules { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public DataTypeDomains dataTypeDomains { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public Profile profile { get; set; }
    }
}
